import { ref, computed } from "vue";
import { defineStore } from "pinia";

export const useCurrentUserStore = defineStore("currentUser", {
  state: () => {
    return {
      isLogin: localStorage.getItem("ats-user-token"),
      name:
        (localStorage.getItem("ats-user-info") &&
          localStorage.getItem("ats-user-info") != "undefined" &&
          JSON.parse(localStorage.getItem("ats-user-info"))?.name) ||
        "",
      headImage: localStorage.getItem("ats-user-headImage"),
      manageMenuIndex: localStorage.getItem("ats-manage-menu-index"),
      portalMenuIndex: localStorage.getItem("ats-portal-menu-index"),
    };
  },
});
